package com.treasure.hunt.mode

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.module.lemlin.mode.ViewModelSubscribe
import com.module.lemlin.rxhttp.HttpServiceData
import com.module.lemlin.rxhttp.HttpServiceResponse
import com.treasure.hunt.api.cardReceiveCart
import com.treasure.hunt.api.cardUserGiveCard
import io.reactivex.rxjava3.disposables.Disposable

class MainViewMode(application: Application) : TaskViewMode(application) {

    val giveLiveData = MutableLiveData<HttpServiceResponse<HttpServiceData>>()


    fun cardUserGiveCard(cartId: String, receiveUserId: String) {
        val disposable: Disposable =
            cardUserGiveCard(cartId, receiveUserId, ViewModelSubscribe(giveLiveData))
        dispose.add(disposable)
    }



    fun cardReceiveCart(giveId: String) {
        val disposable: Disposable =
            cardReceiveCart(giveId,  ViewModelSubscribe(giveLiveData))
        dispose.add(disposable)
    }
}